﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminmain.master" AutoEventWireup="true" CodeFile="ListAllUsers.aspx.cs" Inherits="admin_ListAllUsers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:GridView ID="gvUser" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="ObdsUser" ForeColor="#333333" 
        GridLines="None" AllowPaging="True" Width="98%">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:TemplateField HeaderText="Id" SortExpression="UId" Visible="False">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("UId") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:Label ID="lbUId" runat="server" Text='<%# Bind("UId") %>'></asp:Label>
                </EditItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:BoundField ControlStyle-Width="100px" DataField="UName" HeaderText="用户名" 
                SortExpression="UName" >
<ControlStyle></ControlStyle>
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Pwd" SortExpression="Pwd" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="lbPwd" runat="server" Text='<%# Bind("Pwd") %>'></asp:Label>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Email" HeaderText="Email" 
                SortExpression="Email" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField ControlStyle-Width="95px" DataField="QQ" HeaderText="QQ" 
                SortExpression="QQ" >
<ControlStyle></ControlStyle>
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField ControlStyle-Width="110px" DataField="Phone" HeaderText="电话号码" 
                SortExpression="Phone" >
<ControlStyle></ControlStyle>
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="身份" SortExpression="UserRoleId">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlUserIdentity" runat="server" AutoPostBack="True" 
                        SelectedValue='<%# Eval("UserRole.UrId") %>' DataSourceID="ObUserRole" 
                        DataTextField="UrName" DataValueField="UrId">
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="ObUserRole" runat="server" SelectMethod="getModel" 
                        TypeName="BLL.UserRoles"></asp:ObjectDataSource>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("UserRole.UrName") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="状态" SortExpression="UserStateId">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlUserState" runat="server" DataSourceID="ObUserState" 
                        DataTextField="UsName" DataValueField="UsId" 
                        SelectedValue='<%# Eval("UserState.UsId") %>'>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="ObUserState" runat="server" SelectMethod="getModel" 
                        TypeName="BLL.UserStates"></asp:ObjectDataSource>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("UserState.UsName") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" HeaderText="操作" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:CommandField>
            <asp:TemplateField HeaderText="问题" Visible="False">
                <EditItemTemplate>
                    <asp:Label ID="lblQuestion" runat="server" Text='<%# Bind("Question") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblQuestion" runat="server" Text='<%# Bind("Question") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="答案" Visible="False">
                <EditItemTemplate>
                    <asp:Label ID="lblAnswer" runat="server" Text='<%# Bind("Answer") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblAnswer" runat="server" Text='<%# Bind("Answer") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <br />
    <asp:ObjectDataSource ID="ObdsUser" runat="server" 
        SelectMethod="getModel" TypeName="BLL.Users" 
        onupdating="ObdsUser_Updating" DataObjectTypeName="MODEL.Users" 
        UpdateMethod="Update"></asp:ObjectDataSource>
</asp:Content>

